home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / prgtools / prtbnd53.zip / BNDSRC.ZIP / DEMO08.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-16  |  3KB  |  103 lines

  1. unit Demo08;
  2.  
  3. interface
  4.  
  5. uses
  6.   {$IFDEF WIN32} Windows, {$ENDIF} Messages, SysUtils, Classes, Graphics,
  7.   Controls, Forms, Dialogs,  Cb_Types, CBReport, ExtCtrls, CBBand,
  8.   StdCtrls,  CB_Calc, CBSystem, Cb_lab, DBCtrls, DBTables, DB, Grids, DBGrids,
  9.   Cb_grid,  CBDetBan, Cbsubdet;
  10.  
  11. type
  12.   TFBDemo08 = class(TForm)
  13.     DataSource1: TDataSource;
  14.     Query1: TQuery;
  15.     Button1: TButton;
  16.     CBReport1: TCBReport;
  17.     CBDetailBand1: TCBDetailBand;
  18.     Query1ACCT_NBR: TFloatField;
  19.     Query1SYMBOL: TStringField;
  20.     Query1SHARES: TFloatField;
  21.     Query1PUR_PRICE: TFloatField;
  22.     Query1PUR_DATE: TDateField;
  23.     DBText2: TDBText;
  24.     DBText3: TDBText;
  25.     DBText4: TDBText;
  26.     DBText5: TDBText;
  27.     DetailTotal: TCBBand;
  28.     Label3: TLabel;
  29.     CBCalc4: TCBCalc;
  30.     CBCalc5: TCBCalc;
  31.     Title: TCBBand;
  32.     Memo1: TMemo;
  33.     PageHeader: TCBBand;
  34.     PageFooter: TCBBand;
  35.     Label10: TLabel;
  36.     CBSystem1: TCBSystem;
  37.     CBSystem2: TCBSystem;
  38.     CBSystem3: TCBSystem;
  39.     Label11: TLabel;
  40.     Label12: TLabel;
  41.     DetailFooter: TCBSubDetBand;
  42.     Label13: TLabel;
  43.     CBCalc3: TCBCalc;
  44.     CBCalc2: TCBCalc;
  45.     CBCalc1: TCBCalc;
  46.     DetailHeader: TCBSubDetBand;
  47.     Label2: TLabel;
  48.     DBText8: TDBText;
  49.     Label4: TLabel;
  50.     Label5: TLabel;
  51.     Label6: TLabel;
  52.     Label8: TLabel;
  53.     Label7: TLabel;
  54.     Label9: TLabel;
  55.     procedure Button1Click(Sender: TObject);
  56.     procedure DetailHeaderBeforePrint(Sender: TObject);
  57.     procedure OldDetailFooterBeforePrint(Sender: TObject);
  58.   private
  59.     Acct: real;
  60.   public
  61.     { Public declarations }
  62.   end;
  63.  
  64. var
  65.   FBDemo08: TFBDemo08;
  66.  
  67. implementation
  68.  
  69. {$R *.DFM}
  70.  
  71. procedure TFBDemo08.Button1Click(Sender: TObject);
  72. begin
  73. Acct := 0;
  74. CBReport1.Execute;
  75. end;
  76.  
  77.  
  78. procedure TFBDemo08.DetailHeaderBeforePrint(Sender: TObject);
  79. begin
  80.         { This is used to tell the header when to print the band }
  81.         if Acct <> Query1ACCT_NBR.Value then begin
  82.         CBReport1.PrintBand(True);
  83.       Acct := Query1ACCT_NBR.Value;
  84.       Exit;
  85.    end;
  86.    CBReport1.PrintBand(False);
  87. end;
  88.  
  89. procedure TFBDemo08.OldDetailFooterBeforePrint(Sender: TObject);
  90. begin
  91.         { This is used to tell the footer when to print the band }
  92.    { Please note that the TCBCalc component is used for strings etc because }
  93.    {  the normal data-aware components prints the wrong information }
  94.         if Acct <> Query1ACCT_NBR.Value then begin
  95.         CBReport1.PrintBand(True);
  96.       Exit;
  97.    end;
  98.    CBReport1.PrintBand(False);
  99.  
  100. end;
  101.  
  102. end.
  103.